﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;
using Documents.web.Helpers;
using System.IO;
using System.Xml.Xsl;
using Documents.Common.Interfaces;

namespace Documents.web.Models
{
    public class PatientDocumentsViewModel
    {
        public XmlDocument CategoryList { get; private set; }
        public XmlDocument DocumentList { get; private set; }
        public XmlDocument Document { get; private set; }
        public XmlDocument Demographics { get; private set; }
        public XmlDocument CareEvents { get; private set; }
        
        
        
        public string Markup { get; private set; }
        public PatientDocumentsViewModel() { }
        public PatientDocumentsViewModel(string subjectIdentifiers, IServiceHelper helper, IPasHelper pashelper)
        {
            CategoryList = helper.Get("Categories");
            CareEvents = helper.Get("CareEvents"); // Patient based!
            DocumentList = helper.Get("Documents/?subjectIdentifiers=" + subjectIdentifiers);// Patient based!
            if (!string.IsNullOrEmpty(subjectIdentifiers))
            {
                Demographics = pashelper.GetPatient(subjectIdentifiers);
            }
            else
                Demographics = new XmlDocument();
       }
    }
}
